# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=nsdtool
pkgver=0.1
pkgrel=6
groups=('blackarch' 'blackarch-networking' 'blackarch-scanner')
pkgdesc='A netgear switch discovery tool. It contains some extra features like bruteoforce and setting a new password.'
arch=('any')
url='http://www.curesec.com/en/publications/tools.html'
license=('custom:unknown')
depends=('python' 'python2' 'python3' 'python2-configparser')
source=('https://dl.packetstormsecurity.net/UNIX/utilities/nsdtool.tar.bz2')
sha512sums=('433c855055e00879b09c56c9a9e856442efbbc118588a271bec794f91cf7a87c07557341f146070af16d8ac1ba3b484b7195f29bf3936b7cee680528ff1e694e')

package() {
  cd "$pkgname/project"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a *	"$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname/
exec python main.py "\$@"
EOF
  chmod +x "$pkgdir/usr/bin/$pkgname"
}

